﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Tongiao.Manager;
using Tongiao.ManagerBase;
using Tongiao.Entity;

public partial class Control_News_NewsIndex : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        LoadNewsRandomIndex();
    }

    void LoadNewsRandomIndex()
    {
        DataTable dt = Tg_NewsInfosManager.CreateInstant().GetRandomNewsIndex();
        if (dt.Rows.Count > 0)
        {
            repNews.DataSource = dt;
            repNews.DataBind();
        }
    }
    public static string SplitString(string str, int length)
    {
        string result = "";
        string[] temp = str.Split(' ');
        if (temp.Length >= length)
        {
            for (int i = 0; i < length; i++)
                result += temp[i] + " ";
            return result;
        }
        return str;
    }
}
